var mongoose = require('mongoose');
var Schema = mongoose.Schema;

const animalSchema = new Schema({
    name: String,
    type: String
})

animalSchema.methods.findSimilarTypes = function(callback){
    return this.model('Animal').find({type: this.type}, callback);
}

module.exports = animalSchema;